home *** CD-ROM | disk | FTP | other *** search
- ;Horizontal Scroll 640
- ;---------------------
- ;This opens an extra wide screen of 256x640 pixels, and hardware scrolls
- ;left and right. This is *totally* inadequate for platformers, shoot'em-ups
- ;etc because the picture size takes up huge amounts of memory. However for
- ;games like Skidmarks, Lemmings, Monkey Island, etc, such large screens can
- ;be a necessity.
-
- opt o+
-
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- LOCAL = 1
-
- SECTION "ExtraLarge640",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l ($4).w,a6
- lea GMS_Name(pc),a1
- moveq #$00,d0
- CALL OpenLibrary
- move.l d0,GMS_Base
- beq Quit
-
- move.l GMS_Base(pc),a6 ;Tell GMS that we want to add a
- CALL SetUserPri
-
- lea ScreenStruct(pc),a0 ;screen for use.
- CALL Add_Screen
- tst.l d0
- bne.s Error
-
- move.l SS_MemPtr1(a0),a1 ;Destination = SS_MemPtr1.
- lea PackedPicFile(pc),a0 ;File Name.
- CALL QuickLoad
- tst.l d0
- beq.s Error
-
- lea ScreenStruct(pc),a0 ;Unpack the data on top of itself.
- move.l SS_MemPtr1(a0),a1
- move.l a1,a0
- moveq #$00,d0
- CALL SmartUnpack
-
- lea ScreenStruct(pc),a0 ;Now show the screen/pic.
- CALL Show_Screen
-
- ;===========================================================================;
- ; MAIN LOOP
- ;===========================================================================;
-
- Loop: CALL Wait_OSVBL
- tst.w Direction
- beq.s .Right
-
- .Left cmp.w #-16,SS_ScrollXCount(a0)
- ble.s .Right
- move.w #1,Direction
- moveq #-1,d0
- bra.s .scroll
-
- .Right cmp.w #320-16,SS_ScrollXCount(a0)
- bge.s .Left
- clr.w Direction
- moveq #1,d0
- .scroll CALL HWScroll_Horizontal ;Reposition_Screen
-
- .done moveq #JPORT1,d0 ;Port 1 (Mouse)
- moveq #JT_SWITCH,d1
- CALL Read_JoyPort
- btst #JS_FIRE1,d0
- beq.s Loop
-
- ;===========================================================================;
- ; RETURN TO DOS
- ;===========================================================================;
-
- CALL Delete_Screen ;Give back screen memory etc.
- Error move.l GMS_Base(pc),a1
- move.l ($4).w,a6
- CALL CloseLibrary
- Quit MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- Direction:
- dc.w 0
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 4
-
- ScreenStruct:
- dc.l "GSV1"
- dc.l 0,0,0 ;Screen_Mem1/2/3
- dc.l 0 ;Child_Screen1
- dc.l ScreenPalette ;Adr_Palette
- dc.l 0 ;Adr_Colour_List
- dc.l 16 ;Amt_Colours (dependent on planes)
- dc.w 256,320,320/8 ;Screen Height/Width/ByteWidth
- dc.w 256,640,640/8 ;Picture Height/Width/ByteWidth
- dc.w AMT_PLANES ;Amt_Planes
- dc.w 0,0 ;Top Of Screen, X/Y
- dc.w 16/8 ;Scroll buffer in pixels/8.
- dc.w 0 ;X offset (for hor. scrolling).
- dc.w 0 ;Y offset (for ver. scrolling).
- dc.l NOBURST ;Special attributes.
- dc.w LORES ;Screen mode.
- dc.b INTERLEAVED ;Screen type
- dc.b 0 ;Screen Is Being Displayed?
- dc.l 0,0 ;Reserved area.
- even
-
- ScreenPalette:
- dc.w $0000,$0400,$0501,$0501,$0601,$0701,$0701,$0801
- dc.w $0901,$0A01,$0B02,$0432,$0CC0,$0F00,$0211,$0880
-
- PackedPicFile:
- IFNE LOCAL
- dc.b "GAMESLIB:"
- ENDC
- dc.b "data/Pic640x256.pak",0
- even
-